#include "Item.h"
#include "Image.h"
#include "Position.h"

Item::Item()
{
	m_image = 0;
}

Item::~Item()
{
	//
}

uint16_t Item::getId() const
{
	return m_itemId;
}
		
void Item::setId(const uint16_t newid)
{
	m_itemId = newid;
}

void Item::draw() const
{
	Image* image = Image::getImage(m_itemId);
	if(!image)
		return;
		
	Position pos = getPosition();
	
	SDL_Rect rect;
	rect.x = (float)pos.x * 43;
	rect.y = (float)pos.y * 43;
	rect.w = 43;
	rect.h = 43;

	image->draw(&rect);
}
